package klass.parse.domain.constant.factory;

import klass.parse.domain.constant.Constant;
import klass.parse.domain.constant.ConstantMethodRefInfo;

import java.io.InputStream;

import static klass.parse.util.InputStreamUtils.*;

public class ConstantMethodRefFactory extends BaseConstantFactory {
    @Override
    public Constant create(InputStream inputStream) {
        short nameIndex = nextShort(inputStream);
        short nameAndTypeIndex = nextShort(inputStream);
        return new ConstantMethodRefInfo(nameIndex, nameAndTypeIndex);
    }
}
